<?php
/*
 * Created on 2011-4-23
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
require ('../Common.inc.php');
$ua=strtolower(getenv(HTTP_USER_AGENT));

if(preg_match('/msie/',$ua)){
	$agent='ie';
}else if(preg_match('/firefox/',$ua)){
	$agent='firefox';
}else{
	$agent='other';
}
$identity=$_GET['identity'];
$prefix='var identity="'.$identity.'";
';
switch ($agent){
	case 'ie':
	$jstr=file_get_contents(SERVER_ROOT_PATH.'/js/preader_ie.js');
	break;
	case 'firefox':
	case 'other':
	$jstr=file_get_contents(SERVER_ROOT_PATH.'/js/preader.js');
	break;
	default:
	$jstr=file_get_contents(SERVER_ROOT_PATH.'/js/preader_ie.js');
}

header("Content-Type:application/javascript");
echo $prefix.$jstr;
?>
